﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Models;
using BLL;

namespace CSMF
{
    public partial class NewsDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IList<NewsInfo> news = NewsInfoManager.GetNewsInfosByTypeID(2);
                rptNews1.DataSource = news;
                rptNews1.DataBind();

                IList<NewsInfo> news2 = NewsInfoManager.GetNewsInfosByTypeID(3);
                rptNews2.DataSource = news2;
                rptNews2.DataBind();

                int id = Convert.ToInt32(Request.QueryString["id"]);


                PostComment.CommentObjId = id;
                PostComment.CommentObjType = (int)ObjType.媒体中心新闻;



                NewsInfo info = NewsInfoManager.GetNewsInfoByID(id);
                litTitle.Text = info.Title;
                litNewsDate.Text = info.NewsDate.ToString("yyyy.MM.dd");
                litNewsContent.Text = info.NewsContent;
                imgNews.ImageUrl = "UpLoad/newsImage/" + info.Image;
                litTag.Text = info.Tag;
            }
        }
    }
}
